<template>
  <div class="mod-config">
    <el-form :inline="true" :model="dataForm" ref="dataForm" @keyup.enter.native="getDataList()">
      <el-form-item>
        <el-input v-model="dataForm.dianPuMingCheng" placeholder="店铺名称" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.gongSiMingCheng" placeholder="公司名称" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.diQu" placeholder="地区" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-select v-model="dataForm.shiFouRenZheng" clearable placeholder="状态">
          <el-option label="已认证" value='已认证'></el-option>
          <el-option label="待审核" value='待审核'></el-option>
          <el-option label="不通过" value='不通过'></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.xiaoDianJieShao" placeholder="小店介绍" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.zhuYingPinZhong" placeholder="主营品种" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.lianXiRen" placeholder="联系人" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.lianXiFangShi" placeholder="联系方式" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.shenFenZhengHao" placeholder="身份证号" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="dataForm.jingYingDiZhi" placeholder="经营地址" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="getDataList(1)">查询</el-button>
<!--        <el-button type="primary" @click="addOrUpdateHandle()">新增
        </el-button>-->
        <el-button type="danger" @click="deleteHandle()"
                   :disabled="dataListSelections.length <= 0">批量删除
        </el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="dataList"
      border
      v-loading="dataListLoading"
      @selection-change="selectionChangeHandle"
      style="width: 100%;">
      <el-table-column
        label="选中"
        type="selection"
        header-align="center"
        align="center"
        width="50">
      </el-table-column>
      <el-table-column
        type="index"
        label="序号"
        header-align="center"
        align="center"
        width="50">
      </el-table-column>
      <el-table-column
        prop="dianPuMingCheng"
        header-align="center"
        align="center"
        label="店铺名称">
      </el-table-column>
<!--      <el-table-column
        prop="gongSiMingCheng"
        header-align="center"
        align="center"
        label="公司名称">
      </el-table-column>
      <el-table-column
        prop="diQu"
        header-align="center"
        align="center"
        label="地区">
      </el-table-column>-->
      <el-table-column
        prop="shiFouRenZheng"
        header-align="center"
        align="center"
        label="认证状态">
      </el-table-column>
      <el-table-column
        prop="createTime"
        header-align="center"
        align="center"
        label="注册时间">
      </el-table-column>
<!--      <el-table-column
        prop="xiaoDianJieShao"
        header-align="center"
        align="center"
        label="小店介绍">
      </el-table-column>
      <el-table-column
        prop="zhuYingPinZhong"
        header-align="center"
        align="center"
        label="主营品种">
      </el-table-column>-->
      <el-table-column
        prop="lianXiRen"
        header-align="center"
        align="center"
        label="联系人">
      </el-table-column>
      <el-table-column
        prop="lianXiFangShi"
        header-align="center"
        align="center"
        label="联系方式">
      </el-table-column>
      <el-table-column
        prop="xingBie"
        header-align="center"
        align="center"
        label="性别">
      </el-table-column>
<!--
      <el-table-column
        prop="leiXing"
        header-align="center"
        align="center"
        label="类型">
      </el-table-column>
      <el-table-column
        prop="gongSiZiZhi"
        header-align="center"
        align="center"
        label="公司资质">
      </el-table-column>
      <el-table-column
        prop="yingYeZhiZhao"
        header-align="center"
        align="center"
        label="营业执照">
      </el-table-column>
      <el-table-column
        prop="jianCeZhengShu"
        header-align="center"
        align="center"
        label="检测证书">
      </el-table-column>
      <el-table-column
        prop="gongSiZhaoPian"
        header-align="center"
        align="center"
        label="公司照片">
      </el-table-column>-->
      <el-table-column
        prop="jingYingDiZhi"
        header-align="center"
        align="center"
        label="经营地址">
      </el-table-column>
      <el-table-column
        prop="zhuangTai"
        header-align="center"
        align="center"
        label="状态">
      </el-table-column>
      <el-table-column
        prop="shenFenZhengHao"
        header-align="center"
        align="center"
        label="身份证号">
      </el-table-column>
      <el-table-column
        fixed="right"
        header-align="center"
        align="center"
        label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small"
                     @click="infoHandle(scope.row.id)"><i class="el-icon-info"></i>查看详情
          </el-button>
          <el-button type="text" size="small"
                     @click="addOrUpdateHandle(scope.row.id)"><i class="el-icon-edit"></i>修改
          </el-button>
          <el-button type="text" size="small"
                     @click="jinYong(scope.row.id)"><i class="el-icon-edit"></i>禁用
          </el-button>
          <el-button type="text" size="small"
                     @click="deleteHandle(scope.row.id)"><i class="el-icon-delete"></i>删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"
      :page-sizes="[10, 20, 50, 100]"
      :page-size="pageSize"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper">
    </el-pagination>
    <!-- 弹窗, 新增 / 修改 -->
    <el-dialog title="添加或编辑" :visible.sync="addOrUpdateVisible" :modal-append-to-body="false" :modal="false">
      <el-form :rules="dataRule" :model="dataSaveForm" ref="dataSaveForm" @keyup.enter.native="dataFormSubmit()">
        <el-form-item hidden :label-width="'120px'" prop="id">
          <el-input v-model="dataSaveForm.id" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="店铺名称" :label-width="'120px'" prop="dianPuMingCheng">
          <el-input v-model="dataSaveForm.dianPuMingCheng" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="公司名称" :label-width="'120px'" prop="gongSiMingCheng">
          <el-input v-model="dataSaveForm.gongSiMingCheng" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="地区" :label-width="'120px'" prop="diQu">
          <el-input v-model="dataSaveForm.diQu" autocomplete="off"></el-input>
        </el-form-item>
<!--        <el-form-item label="是否认证" :label-width="'120px'" prop="shiFouRenZheng">
          <el-input v-model="dataSaveForm.shiFouRenZheng" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="注册时间" :label-width="'120px'" prop="zhuCeShiJian">
          <el-input v-model="dataSaveForm.zhuCeShiJian" autocomplete="off"></el-input>
        </el-form-item>-->
        <el-form-item label="小店介绍" :label-width="'120px'" prop="xiaoDianJieShao">
          <el-input v-model="dataSaveForm.xiaoDianJieShao" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="主营品种" :label-width="'120px'" prop="zhuYingPinZhong">
          <el-input v-model="dataSaveForm.zhuYingPinZhong" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="联系人" :label-width="'120px'" prop="lianXiRen">
          <el-input v-model="dataSaveForm.lianXiRen" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="联系方式" :label-width="'120px'" prop="lianXiFangShi">
          <el-input v-model="dataSaveForm.lianXiFangShi" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="性别" :label-width="'120px'" prop="xingBie">
          <el-input v-model="dataSaveForm.xingBie" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="身份证号" :label-width="'120px'" prop="shenFenZhengHao">
          <el-input v-model="dataSaveForm.shenFenZhengHao" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="类型" :label-width="'120px'" prop="leiXing">
          <el-input v-model="dataSaveForm.leiXing" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="公司资质" :label-width="'120px'" prop="gongSiZiZhi">
<!--          <el-input v-model="dataSaveForm.gongSiZiZhi" autocomplete="off"></el-input>-->
          <img-upload
            v-model="dataSaveForm.gongSiZiZhi"
            :file-id="dataSaveForm.gongSiZiZhi"
            :list="list1"
            :is-boolean="isBoolean1"
            ref="pic1"
          >
          </img-upload>
          <!--            :file-id="dataSaveForm.gongSiZiZhi"-->
        </el-form-item>
        <el-form-item label="营业执照" :label-width="'120px'" prop="yingYeZhiZhao">
<!--          <el-input v-model="dataSaveForm.yingYeZhiZhao" autocomplete="off"></el-input>-->
          <img-upload
            v-model="dataSaveForm.yingYeZhiZhao"
            :file-id="dataSaveForm.yingYeZhiZhao"
            :list="list2"
            :is-boolean="isBoolean2"
            ref="pic2"
          >
          </img-upload>
        </el-form-item>
        <el-form-item label="检测证书" :label-width="'120px'" prop="jianCeZhengShu">
<!--          <el-input v-model="dataSaveForm.jianCeZhengShu" autocomplete="off"></el-input>-->
          <img-upload
            v-model="dataSaveForm.jianCeZhengShu"
            :file-id="dataSaveForm.jianCeZhengShu"
            :list="list3"
            :is-boolean="isBoolean3"
            ref="pic3"
          >
          </img-upload>
        </el-form-item>
        <el-form-item label="公司照片" :label-width="'120px'" prop="gongSiZhaoPian">
<!--          <el-input v-model="dataSaveForm.gongSiZhaoPian" autocomplete="off"></el-input>-->
          <img-upload v-if="dataSaveForm.gongSiZhaoPian"
            v-model="dataSaveForm.gongSiZhaoPian"
            :file-id="dataSaveForm.gongSiZhaoPian"
            :list="list4"
            :is-boolean="isBoolean4"
            ref="pic4"
          >
          </img-upload>
        </el-form-item>
        <el-form-item label="经营地址" :label-width="'120px'" prop="jingYingDiZhi">
          <el-input v-model="dataSaveForm.jingYingDiZhi" autocomplete="off"></el-input>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="qx()">取 消</el-button>
        <el-button type="primary" @click="dataFormSubmit()">确 定</el-button>
      </div>
    </el-dialog>


    <!-- 详情 -->
    <el-dialog title="客户管理客户明细" :visible.sync="infoVisible" :modal-append-to-body="false" :modal="false">
      <div class="mod-config">
        <el-descriptions :column="2" title="基本信息" :colon="false" border content-class-name="customContent" label-class-name="customLable">
          <el-descriptions-item label="店铺名称">{{ this.infoList.dianPuMingCheng }}</el-descriptions-item>
          <el-descriptions-item label="公司名称">{{ this.infoList.gongSiMingCheng }}</el-descriptions-item>
          <el-descriptions-item label="地区">{{ this.infoList.diQu }}</el-descriptions-item>
          <el-descriptions-item label="是否认证">{{ this.infoList.shiFouRenZheng }}</el-descriptions-item>
          <el-descriptions-item label="注册时间">{{ this.infoList.createTime }}</el-descriptions-item>
          <el-descriptions-item label="小店介绍">{{ this.infoList.xiaoDianJieShao }}</el-descriptions-item>
          <el-descriptions-item label="主营品种">{{ this.infoList.zhuYingPinZhong }}</el-descriptions-item>
          <el-descriptions-item label="联系人">{{ this.infoList.lianXiRen }}</el-descriptions-item>
          <el-descriptions-item label="联系方式">{{ this.infoList.lianXiFangShi }}</el-descriptions-item>
          <el-descriptions-item label="性别">{{ this.infoList.xingBie }}</el-descriptions-item>
          <el-descriptions-item label="身份证号">{{ this.infoList.shenFenZhengHao }}</el-descriptions-item>
          <el-descriptions-item label="类型">{{ this.infoList.leiXing }}</el-descriptions-item>
<!--          <el-descriptions-item label="公司资质">{{ this.infoList.gongSiZiZhi }}</el-descriptions-item>-->
          <!--          <el-descriptions-item label="营业执照">{{ this.infoList.yingYeZhiZhao }}</el-descriptions-item>-->
<!--          <el-descriptions-item label="检测证书">{{ this.infoList.jianCeZhengShu }}</el-descriptions-item>
          <el-descriptions-item label="公司照片">{{ this.infoList.gongSiZhaoPian }}</el-descriptions-item>-->
          <el-descriptions-item label="公司资质" >
            <img width="200px" height="200px" v-if="infoList.gongSiZiZhi" :src="this.$http.adornUrl('/api-file/file/view/file?fileId='+ this.infoList.gongSiZiZhi) ">
          </el-descriptions-item>
          <el-descriptions-item label="营业执照" >
            <img width="200px" height="200px" v-if="infoList.yingYeZhiZhao" :src="this.$http.adornUrl('/api-file/file/view/file?fileId='+ this.infoList.yingYeZhiZhao) ">
          </el-descriptions-item>
          <el-descriptions-item label="检测证书" >
            <img width="200px" height="200px" v-if="infoList.jianCeZhengShu" :src="this.$http.adornUrl('/api-file/file/view/file?fileId='+ this.infoList.jianCeZhengShu) ">
          </el-descriptions-item>
          <el-descriptions-item label="公司照片" >
            <img width="200px" height="200px" v-if="infoList.gongSiZhaoPian" :src="this.$http.adornUrl('/api-file/file/view/file?fileId='+ this.infoList.gongSiZhaoPian) ">
          </el-descriptions-item>
          <el-descriptions-item label="经营地址">{{ this.infoList.jingYingDiZhi }}</el-descriptions-item>

        </el-descriptions>
          <div class="el-descriptions__title custom-title">店铺商品</div>
           <div>
             <el-tabs v-model="activeName" @tab-click="handleClick">
<!--               v-if="activeName =='first'"   v-if="activeName == 'second'"-->
               <el-tab-pane label="药材供应"  name="first">
                 <yao-cai-gong-ying ref="first" :yongHuId="infoList.guanLianYongHu"></yao-cai-gong-ying>
               </el-tab-pane>
               <el-tab-pane label="药材采购" name="second">
                 <YaoCaiCaiGou  ref="second" :yongHuId="infoList.guanLianYongHu"></YaoCaiCaiGou>
               </el-tab-pane>
             </el-tabs>
           </div>


      </div>

      <div slot="footer" class="dialog-footer">
        <el-button @click="qxinfo()">取 消</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import YaoCaiGongYing from './yaoCaiGongYing.vue'
import YaoCaiCaiGou from './yaoCaiCaiGou.vue'
import ImgUpload from "../../components/upload/ImgUpload.vue";
import {isMobile } from "@/utils/validate";
export default {
  data() {
    var validateMobile = (rule, value, callback) => {
      if (!isMobile(value)) {
        callback(new Error("手机号格式错误"));
      } else {
        callback();
      }
    }
    return {
      dataForm: {
        dianPuMingCheng: '',
        gongSiMingCheng: '',
        diQu: '',
        shiFouRenZheng: '',
        zhuCeShiJian: '',
        xiaoDianJieShao: '',
        zhuYingPinZhong: '',
        lianXiRen: '',
        lianXiFangShi: '',
        xingBie: '',
        shenFenZhengHao: '',
        leiXing: '',
        gongSiZiZhi: '',
        yingYeZhiZhao: '',
        jianCeZhengShu: '',
        gongSiZhaoPian: '',
        jingYingDiZhi: '',
        guanLianYongHu: '',
      },
      activeName: 'first',
      dataSaveForm: {
        dianPuMingCheng: '',
        gongSiMingCheng: '',
        diQu: '',
        shiFouRenZheng: '',
        zhuCeShiJian: '',
        xiaoDianJieShao: '',
        zhuYingPinZhong: '',
        lianXiRen: '',
        lianXiFangShi: '',
        xingBie: '',
        shenFenZhengHao: '',
        leiXing: '',
        gongSiZiZhi: '',
        yingYeZhiZhao: '',
        jianCeZhengShu: '',
        gongSiZhaoPian: '',
        jingYingDiZhi: '',
        guanLianYongHu: '',
      },
      dataRule: {
        dianPuMingCheng: [
          {required: true, message: '店铺名称不能为空', trigger: 'blur'}
        ],
        gongSiMingCheng: [
          {required: true, message: '公司名称不能为空', trigger: 'blur'}
        ],

        xiaoDianJieShao: [
          {required: true, message: '小店介绍不能为空', trigger: 'blur'}
        ],
        zhuYingPinZhong: [
          {required: true, message: '主营品种不能为空', trigger: 'blur'}
        ],
        lianXiRen: [
          {required: true, message: '不能为空', trigger: 'blur'}
        ],
        lianXiFangShi: [
          {required: true, message: '联系方式不能为空', trigger: 'blur'},
          { validator: validateMobile, trigger: "blur" },
        ],
        xingBie: [
          {required: true, message: '性别不能为空', trigger: 'blur'}
        ],
        shenFenZhengHao: [
          {required: true, message: '身份证号不能为空', trigger: 'blur'},
          { pattern: /(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,message: '请输入正确的个人身份证号',trigger: 'blur' }
        ],
        leiXing: [
          {required: true, message: '类型不能为空', trigger: 'blur'}
        ],
        gongSiZiZhi: [
          {required: true, message: '公司资质不能为空', trigger: 'blur'}
        ],
        yingYeZhiZhao: [
          {required: true, message: '营业执照不能为空', trigger: 'blur'}
        ],
        jianCeZhengShu: [
          {required: true, message: '检测证书不能为空', trigger: 'blur'}
        ],
        gongSiZhaoPian: [
          {required: true, message: '公司照片不能为空', trigger: 'blur'}
        ],
        jingYingDiZhi: [
          {required: true, message: '经营地址不能为空', trigger: 'blur'}
        ],
      },
      dataList: [],
      pageIndex: 1,
      pageSize: 10,
      totalPage: 0,
      dataListLoading: false,
      dataListSelections: [],
      addOrUpdateVisible: false,

      infoList: [],
      infoLoading: false,
      infoVisible: false,
      list1:[],
      isBoolean1: false,
      list2:[],
      isBoolean2: false,
      list3:[],
      isBoolean3: false,
      list4:[],
      isBoolean4: false,

    }
  },
  components: {
    ImgUpload,
    YaoCaiGongYing,
    YaoCaiCaiGou
  },
  activated() {
    // this.$nextTick(() => {this.$refs['dataForm'].resetFields()})
    this.dataForm.dianPuMingCheng=''
    this.dataForm.gongSiMingCheng=''
    this.dataForm.diQu=''
    this.dataForm.shiFouRenZheng=''
    this.dataForm.xiaoDianJieShao=''
    this.dataForm.zhuYingPinZhong=''
    this.dataForm.lianXiRen=''
    this.dataForm.lianXiFangShi=''
    this.dataForm.shenFenZhengHao=''
    this.dataForm.jingYingDiZhi=''

    this.getDataList()
  },
  methods: {
    isValidID(idNumber) {
      const pattern = /^[1-9]\d{5}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|[Xx])$/;
      return pattern.test(idNumber);
    },
    getDataList(pageIndex) {

      if (pageIndex) {
        this.pageIndex = pageIndex
      }
      this.dataListLoading = true
      this.$http({
        url: this.$http.adornUrl('/api-trading/keHuGuanLi/keHuGuanLiKeHuMingXi/list'),
        method: 'get',
        params: this.$http.adornParams({
          'page': this.pageIndex,
          'limit': this.pageSize,
          'dianPuMingCheng': this.dataForm.dianPuMingCheng,
          'gongSiMingCheng': this.dataForm.gongSiMingCheng,
          'diQu': this.dataForm.diQu,
          'shiFouRenZheng': this.dataForm.shiFouRenZheng,
          'zhuCeShiJian': this.dataForm.zhuCeShiJian,
          'xiaoDianJieShao': this.dataForm.xiaoDianJieShao,
          'zhuYingPinZhong': this.dataForm.zhuYingPinZhong,
          'lianXiRen': this.dataForm.lianXiRen,
          'lianXiFangShi': this.dataForm.lianXiFangShi,
          'xingBie': this.dataForm.xingBie,
          'shenFenZhengHao': this.dataForm.shenFenZhengHao,
          'leiXing': this.dataForm.leiXing,
          'gongSiZiZhi': this.dataForm.gongSiZiZhi,
          'yingYeZhiZhao': this.dataForm.yingYeZhiZhao,
          'jianCeZhengShu': this.dataForm.jianCeZhengShu,
          'gongSiZhaoPian': this.dataForm.gongSiZhaoPian,
          'jingYingDiZhi': this.dataForm.jingYingDiZhi,
          'guanLianYongHu': this.dataForm.guanLianYongHu,
        })
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.dataList = data.data.records
          this.totalPage = Number(data.data.total)
        } else {
          this.dataList = []
          this.totalPage = 0
        }
        this.dataListLoading = false
      })
    },
    handleClick(tab, event) {
      this.activeName=tab.name
      // console.log(tab, event);
       this.$refs[this.activeName].getDataList()

    },
    // 每页数
    sizeChangeHandle(val) {
      this.pageSize = val
      this.pageIndex = 1
      this.getDataList()
    },
    // 当前页
    currentChangeHandle(val) {
      this.pageIndex = val
      this.getDataList()
    },
    // 多选
    selectionChangeHandle(val) {
      this.dataListSelections = val
    },
    qx() {
      this.addOrUpdateVisible = false;

    },
    jinYong(id){
      this.$http({
        url: this.$http.adornUrl(`/api-trading/keHuGuanLi/keHuGuanLiKeHuMingXi/update`),
        method: 'post',
        data: this.$http.adornData({
          'id': id,
          'zhuangTai': "禁用",
        })
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.$message({
            message: '操作成功',
            type: 'success',
            duration: 1500,
            onClose: () => {
              this.addOrUpdateVisible = false
              this.getDataList()
            }
          })
        } else {
          this.$message.error(data.msg)
        }
      })
    },
    // 新增 / 修改
    addOrUpdateHandle(id) {
      this.addOrUpdateVisible = true;
      $(".el-upload-list li").remove();
      this.$nextTick(() => {
        this.$refs['dataSaveForm'].resetFields()
        this.list1=[]
          this.list2=[]
          this.list3=[]
          this.list4=[]

        if (id) {
          this.$http({
            url: this.$http.adornUrl(`/api-trading/keHuGuanLi/keHuGuanLiKeHuMingXi/getById`),
            method: 'get',
            params: this.$http.adornParams({"id": id})
          }).then(({data}) => {
            if (data && data.code === 0) {
              this.dataSaveForm.id = data.data.id
              this.dataSaveForm.dianPuMingCheng = data.data.dianPuMingCheng;
              this.dataSaveForm.gongSiMingCheng = data.data.gongSiMingCheng;
              this.dataSaveForm.diQu = data.data.diQu;
              this.dataSaveForm.shiFouRenZheng = data.data.shiFouRenZheng;
              this.dataSaveForm.zhuCeShiJian = data.data.zhuCeShiJian;
              this.dataSaveForm.xiaoDianJieShao = data.data.xiaoDianJieShao;
              this.dataSaveForm.zhuYingPinZhong = data.data.zhuYingPinZhong;
              this.dataSaveForm.lianXiRen = data.data.lianXiRen;
              this.dataSaveForm.lianXiFangShi = data.data.lianXiFangShi;
              this.dataSaveForm.xingBie = data.data.xingBie;
              this.dataSaveForm.shenFenZhengHao = data.data.shenFenZhengHao;
              this.dataSaveForm.leiXing = data.data.leiXing;

              this.dataSaveForm.gongSiZiZhi = data.data.gongSiZiZhi;
              console.log(this.dataSaveForm.gongSiZiZhi)
              if(data.data.gongSiZiZhi){
                this.list1=[];
                this.list1.push({name: 'img', url: this.$http.adornUrl('/api-file/file/view/file?fileId=' + data.data.gongSiZiZhi)})
                this.isBoolean1 = true
              }
              this.dataSaveForm.yingYeZhiZhao = data.data.yingYeZhiZhao;
              if(data.data.yingYeZhiZhao){
                this.list2=[];
                this.list2.push({name: 'img', url: this.$http.adornUrl('/api-file/file/view/file?fileId=' + data.data.yingYeZhiZhao)})
                this.isBoolean2 = true
              }
              this.dataSaveForm.jianCeZhengShu = data.data.jianCeZhengShu;
              if(data.data.jianCeZhengShu){
                this.list3=[];
                this.list3.push({name: 'img', url: this.$http.adornUrl('/api-file/file/view/file?fileId=' + data.data.jianCeZhengShu)})
                this.isBoolean3 = true
              }
              this.dataSaveForm.gongSiZhaoPian = data.data.gongSiZhaoPian;
              if(data.data.gongSiZhaoPian){
                this.list4=[];
                this.list4.push({name: 'img', url: this.$http.adornUrl('/api-file/file/view/file?fileId=' + data.data.gongSiZhaoPian)})
                this.isBoolean4 = true
              }


              this.dataSaveForm.jingYingDiZhi = data.data.jingYingDiZhi;

            }
          })
        }
      })

    },
    qxinfo() {
      this.infoVisible = false;

    },
    // 新增 / 修改
    infoHandle(id) {

      this.infoVisible = true;
      this.infoList = [];
       this.activeName='first'

      this.$http({
        url: this.$http.adornUrl(`/api-trading/keHuGuanLi/keHuGuanLiKeHuMingXi/getById`),
        method: 'get',
        params: this.$http.adornParams({"id": id})
      }).then(({data}) => {
        if (data && data.code === 0) {
          this.infoList = data.data;
        }
      })
    },
    // 删除
    deleteHandle(id) {
      var ids = id ? [id] : this.dataListSelections.map(item => {
        return item.id
      })
      this.$confirm(`确定要进行删除操作?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$http({
          url: this.$http.adornUrl('/api-trading/keHuGuanLi/keHuGuanLiKeHuMingXi/delByIds'),
          method: 'post',
          data: this.$http.adornData(ids, false)
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
                this.getDataList()
              }
            })
          } else {
            this.$message.error(data.msg)
          }
        })
      })
    },
    // 表单提交
    dataFormSubmit() {
      this.$refs['dataForm'].validate((valid) => {
        if (valid) {
          this.$http({
            url: this.$http.adornUrl(`/api-trading/keHuGuanLi/keHuGuanLiKeHuMingXi/save`),
            method: 'post',
            data: this.$http.adornData({
              'id': this.dataSaveForm.id || undefined,
              'dianPuMingCheng': this.dataSaveForm.dianPuMingCheng,
              'gongSiMingCheng': this.dataSaveForm.gongSiMingCheng,
              'diQu': this.dataSaveForm.diQu,
              'shiFouRenZheng': this.dataSaveForm.shiFouRenZheng,
              'zhuCeShiJian': this.dataSaveForm.zhuCeShiJian,
              'xiaoDianJieShao': this.dataSaveForm.xiaoDianJieShao,
              'zhuYingPinZhong': this.dataSaveForm.zhuYingPinZhong,
              'lianXiRen': this.dataSaveForm.lianXiRen,
              'lianXiFangShi': this.dataSaveForm.lianXiFangShi,
              'xingBie': this.dataSaveForm.xingBie,
              'shenFenZhengHao': this.dataSaveForm.shenFenZhengHao,
              'leiXing': this.dataSaveForm.leiXing,
              'gongSiZiZhi': this.dataSaveForm.gongSiZiZhi,
              'yingYeZhiZhao': this.dataSaveForm.yingYeZhiZhao,
              'jianCeZhengShu': this.dataSaveForm.jianCeZhengShu,
              'gongSiZhaoPian': this.dataSaveForm.gongSiZhaoPian,
              'jingYingDiZhi': this.dataSaveForm.jingYingDiZhi,
            })
          }).then(({data}) => {
            if (data && data.code === 0) {
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                  this.addOrUpdateVisible = false
                  this.getDataList()
                }
              })
            } else {
              this.$message.error(data.msg)
            }
          })
        }
      })


    },
  }
}
</script>
<style>
.custom-title {
  color: #303133;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-bottom: 20px;
  margin-top: 20px;
}
.customContent{
  color: rgb(19 35 29)
}
.customLable{
  color: rgb(19 35 29 / 77%);text-align:right;width:120px;background-color:#10592a0d;font-weight:bold
}

.el-form-item__error {
  color: #F56C6C;
  font-size: 12px;
  line-height: 1;
  padding-top: 4px;
  /* position: absolute; */
  top: 100%;
  left: 0;
}
</style>
